function send(vm) {
  if (!(/^[1][3,4,5,7,8][0-9]{9}$/.test(vm.loginInfo.phone))) {
    alert("请输入正确的手机号码！");
    return false;
  }
  if (vm.smsSending) {
    return;
  }
  var i = 60;
  vm.smsSending = true;
  var smsText = '60s';
  var timeId = setInterval(function() {
    i--;
    vm.smsText = (i + 's');
    if (i == 0) {
      clearInterval(timeId);
      vm.smsText = '发送验证码';
      vm.smsSending = false;
    }
  }, 1000);
  api.post('/api/v2/user/sendSmsCode', {
    phone: vm.loginInfo.phone,
  }).then(function (res) {
    if (res.data.res_code == 1) {
      vm.loginInfo.mode = true;
      setTimeout(function () {
        vm.loginInfo.isSend = true;
        vm.loginInfo.mode = false;
      },1000);
    }
    if (res.data.res_code != 1) {
      alert('发送失败，请稍后重试！');
      setLog('/api/v2/user/sendSmsCode:fail', JSON.stringify(res.data));
      clearInterval(timeId);
      vm.smsText = '发送验证码';
      vm.smsSending = false;
    }
  }).catch(function (error) {
    setLog('/api/v2/user/sendSmsCode:catch', JSON.stringify(error));
    vm.smsSending = false;
  });
}